package com.erp.utils;



import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @ClassName PropertiesUtils
 * @Description 属性文件工具类
 * @Author songjizhen
 * @Date 2020/6/19 14:41
 * @Version 1.0
 */
public class PropertiesUtils  {

    /**
     * 读取属性文件
     * @param fileName
     * @return
     */
    public static Properties loadProperties(String fileName) {
        InputStream inputStream = PropertiesUtils.class.getClassLoader()
                .getResourceAsStream(fileName + ".properties");
        Properties p = new Properties();
        try {
            p.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return p;
    }

}
